<div class="row" id="rao-vat-page" data-count-url="<?php echo page_url(RAOVAT_SLUG . '/count'); ?>">
	<div class="col-md-8 col-xs-12">
        <div class="row">
            <h2 class="title text-center">Rao vặt</h2>

            <div class="col-md-12 col-xs-12">
                <div class="pull-right"><?php echo $pagingBar; ?></div>
            </div>

            <?php foreach ($aRaoVat as $r) { ?>
            <div class="col-md-12 col-xs-12 mgbt20 sticky-list-line">
                <div class="row">
                    <div class="col-md-12 col-xs-12 mgbt10">
                        <span><i class="fa fa-calendar"></i> <?php echo fdate_format($r->getCreatedAt(), 'd/m/Y'); ?></span>
                        <span class="mgl8">|</span>
                        <strong class="mgl8"><i class="fa fa-map-marker"></i> Nơi áp dụng : </strong><?php echo $r->place_name; ?>
                        <span class="mgl5">|</span>
                        <strong class="mgl8"><i class="fa fa-folder-open"></i> Danh mục : </strong>
                        <a class="inline link-title mgl8" href="<?php echo rao_vat_cate_url($r->cate_slug); ?>"><?php echo $r->cate_title; ?></a>
                    </div>

                    <div class="col-md-4 col-xs-5 col-sm-5 media clear-mgt">
                        <a href="<?php echo rao_vat_single_url($r->getSlug()); ?>" class='thumbnail clear-mgr no-bdr' title="<?php echo $r->getTitle(); ?>">
                            <?php if($r->getImage()!='' && image_exist('public/' . $r->image_folder . '/' . RAOVAT_IMAGE_URL .$r->getImage())) { ?>
                            <img class="media-object sticky-item lazy" src="<?php echo assets('images/blank.gif', true); ?>" data-src="<?php echo raovat_upload($r->getImage(), $r->image_folder); ?>" alt="<?php echo $r->getTitle(); ?>" />
                            <?php } else { ?>
                            <img class="media-object sticky-item lazy" src="<?php echo assets('images/blank.gif', true); ?>" data-src="http://placehold.it/<?php echo urlencode('150x150&text=Hình đại diện');?>" alt="<?php echo $r->getTitle(); ?>" />
                            <?php } ?>
                        </a>
                    </div>
                    <div class="col-md-8 col-xs-7 col-sm-7">
                        <h4 class="clear-pad clear-mgr">
                            <a class="item-title clear-pad f16px" href="<?php echo rao_vat_single_url($r->getSlug()); ?>"><?php echo $r->getTitle(); ?></a>
                        </h4>
                        <p class="mgt10 text-hyphens">
                            <?php echo $r->getDescription(); ?> ...
                            <a class="clear-mgr link-title" title="<?php echo $r->getTitle(); ?>" href='<?php echo rao_vat_single_url($r->getSlug()); ?>'><i class="fa fa-info-circle"></i> Chi tiết</a>
                        </p>
                    </div>
                </div>
            </div>
            <?php } ?>

            <div class="col-md-12 col-xs-12">
                <div class="pull-right"><?php echo $pagingBar; ?></div>
            </div>
        </div>
    </div>

    <div class="col-md-4 col-xs-12 mgt10">
        <?php
        $aSegment = $this->uri->segment_array();
        if(!isset($aSegment[2])){
            $aSegment[2] = '';
            $aSegment[3] = '';
        } else {
            if($aSegment[2]!='c'){
                $aSegment[3] = '';
            }
        }
        ?>
        <div class="list-group clear-radius">
            <?php foreach($aCategories as $cate) { ?>
            <?php
            $activeClass = '';
            $activeIcon = '';
            if($aSegment[3]==$cate->getSlug()){
                $activeClass = 'active';
                $activeIcon = "<i class='glyphicon glyphicon-chevron-right'></i>&nbsp;";
            }
            ?>
            <a class="list-group-item <?php echo $activeClass; ?> clear-radius" href="<?php echo rao_vat_cate_url($cate->getSlug()); ?>">
                <?php echo $activeIcon . $cate->getTitle(); ?>
                <span class="badge raovat-cate" data-cate-id="cate-<?php echo $cate->getId(); ?>"></span>
            </a>
            <?php } ?>
        </div>
    </div>
</div>